#
# Created By: Kevin T. Ryan
# Created On: 2007-Feb-28 @ 3:13:42 PM
# Email:      kevin.t.ryan@gmail.com
# License:    BSD (http://www.opensource.org/licenses/bsd-license.php)
#
# This is a configuration file of sorts for the graphn project.
# It supplies default values that can be easily changed to
# customize your graph/chart, but allows me (the developer) to
# rely on certain variables at least being defined.
#

import gd
from color_palette import ColorPalette
import colors as colormap

# Assume a 400px x 300px png output file
graph_width  = 500
graph_height = 300
graph_output = "png"

# Space around the edges (40px per)
top_space    = 40
bottom_space = 50
left_space   = 60
right_space  = 40

# Some color defaults
background = colormap.white
axis_color = colormap.gray55
colors = ColorPalette(
    [122, 122, 255],    # blue
    [254, 190, 93],     # orange
    colormap.indianred, # red
    [92, 23, 176],      # purple
    [107, 176, 23],     # green
    colormap.yellow,    # yellow
)
linewidth = 1

# Fonts
labelfont = gd.gdFontSmall
# Choices are:
#   gdFontTiny
#   gdFontSmall
#   gdFontMediumBold
#   gdFontLarge
#   gdFontGiant
labelcolor = colormap.gray

# Grids
gridcolor = colormap.gray79
gridspacing = 5 # 5px's between each grid line

class gridstyles:
    sliver = 0
    mini   = 1
    dotted = 2
    dashed = 5

gridstyle = gridstyles.mini
showygrid = True
showxgrid = True
numygridlines = 6  # ie, going from the y-axis to the right side of the graph
numxgridlines = 10 # ie, going from the x-axis up to the title of the graph

# Graph titles
titlefontcolor = colormap.gray20
titlefontsize = gd.gdFontLarge

xaxisfontcolor = colormap.gray40
xaxisfontsize = gd.gdFontMediumBold

yaxisfontcolor = colormap.gray40
yaxisfontsize = gd.gdFontMediumBold

# Bar Charts
origingap = 3 # How many pixels from the y axis should we place the 1st bar?
bargap = 5 # How many pixels should we place bars across each other?
barwidth = None # Normally, you want to let the program calculate the appropriate width
barcolors = ColorPalette(
    colormap.blue,         # blue
    colormap.cadmiumyellow,# orange
    colormap.crimson,      # red
    colormap.blueviolet,   # purple
    colormap.green3,       # green
    colormap.yellow,       # yellow
)

xlabeldisplay = lambda label: "%.1f" % label
ylabeldisplay = lambda label: "%.1f" % label
